package com.example.usharingtest.ui;

import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.usharingtest.R;
import com.example.usharingtest.model.Article;
import com.squareup.picasso.Picasso;

/**
 * Created by X on 2017/8/25.
 */
public class HomepageUI extends AppCompatActivity {
    public boolean loadHomepage(Article article){
       boolean flag = false;
        final TextView UserArticleContet = (TextView)findViewById(R.id.post_content);
        final ImageView userphoto = (ImageView)findViewById(R.id.user_headportrait);
        ImageView articlephoto = (ImageView)findViewById(R.id.post_image);
        TextView username = (TextView)findViewById(R.id.user_name);
        UserArticleContet.setText(article.getContent());
        Picasso.with(HomepageUI.this).load(article.getUser().getUserphotopath()).resize(50,50).centerCrop().into(userphoto);
        Picasso.with(HomepageUI.this).load(article.getPhotopath()).into(articlephoto);
        return flag;
    }
}
